<!DOCTYPE html>
<html>
  <head>
    <meta charset='utf-8'>
    <meta http-equiv='X-UA-Compatible' content='chrome=1'>
    <meta name='viewport' content='width=device-width, initial-scale=1'>
    <meta name='mobile-web-app-capable' content='yes'>
    <meta name='apple-mobile-web-app-capable' content='yes'>

    <meta name='twitter:card' content='summary'>
    <meta name='twitter:title' content='WebXR Samples'>
    <meta name='twitter:description' content='Sample WebXR pages for testing and reference'>

    <link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="96x96" href="../favicon-96x96.png">

    <link rel='stylesheet' href='../css/stylesheet.css'>
    <link rel='stylesheet' href='../css/pygment_trac.css'>

    <style>
      article {
        position: relative;
        padding: 0.5em;
        background-color: rgba(255, 255, 255, 0.90);
        margin-bottom: 1em;
        border-radius: 3px;
      }

      article h3 {
        font-size: 1.0em;
        margin-top: 0px;
        margin-bottom: 0px;
      }

      article h3::before {
        display: inline-block;
        content: attr(data-index) ' - ';
        font-weight: bold;
        white-space: nowrap;
        margin-right: 0.2em;
      }

      article h4 {
        position: absolute;
        right: 0.5em;
        top: 0.5em;
        margin-top: 0px;
        margin-bottom: 0px;
      }

      article p {
        margin: 0.5em;
      }

      article .links {
        margin-left: 0.5em;
        margin-right: 0.5em;
      }

      article a {
        display: inline-block;
      }

      article a:not(:first-child)::before {
        display: inline-block;
        content: '•';
        font-weight: bold;
        white-space: nowrap;
        margin-left: 0.5em;
        margin-right: 0.5em;
      }

      .github-link {
        font-size: 0.8em;
      }
    </style>

    <!--[if lt IE 9]>
    <script src='https://html5shiv.googlecode.com/svn/trunk/html5.js'></script>
    <![endif]-->
    <title>WebXR - Proposals</title>
  </head>
  <body>

    <div class='container' id='container'>
      <header class='header'>
        <div id='nav'>
            <a href='../index.html'>Samples</a>
            <a href='./index.html' class='selected'>Proposals</a>
            <a href='../tests/index.html'>Test Pages</a>
        </div>

        <h1><a href='' class='wordmark'><span>WebXR</span></a></h1>
        <h2 class='tagline'>Proposals</h2>
      </header>

      <main class='main' id='main'>
        <p>These pages test features which have been proposed and are in development but have
          not yet been adopted into the core WebXR Device API. They may have varying support
          across WebXR-compatible browsers, and the APIs presented here are assumed to be
          in flux.<br/>

        <script>
          let pages = [
            { title: 'AR barebones with optional DOM Overlay', category: 'Phone AR',
              path: 'ar-barebones-dom-overlay.html',
              description: 'No-framework test for immersive-ar mode.' },

           { title: 'Phone AR', category: 'Phone AR',
              path: 'phone-ar.html',
              description: 'Demonstrates basic support for passthrough AR on a mobile device.' },

            { title: 'AR Hit Test', category: 'Phone AR',
              path: 'phone-ar-hit-test.html',
              variants: [
                  {name: 'Debug input source events', query: '?debugSources=true'},
                  {name: 'Debug iframe input', query: '?debugSources=true&iframe=true'}],
              description: 'Demonstrates using the Hit Test API to place virtual objects on real-world surfaces.' },

            { title: 'AR Plane Detection & Anchors', category: 'Phone AR',
              path: 'phone-ar-plane-detection-anchors.html',
              variants: [{name: 'Debug input source events', query: '?debugSources=true'}],
              description: 'Demonstrates using the Plane Detection feature, including implementation of ' +
                           'synchronous hit test in JavaScript leveraging obtained plane data and ' +
                           'anchors API to position objects.' },
            { title: 'AR Lighting estimation', category: 'Phone AR',
              path: 'lighting-estimation.html',
              description: 'Demonstrates using the Lighting Estimation feature.' },
            { title: 'AR Camera Access', category: 'Phone AR',
              path: 'camera-access-barebones.html',
              description: 'Demonstrates using the Camera Access feature to obtain and use a camera ' +
                           'image texture.' },
            { title: 'AR Depth Sensing - GPU access', category: 'AR',
              path: 'phone-ar-depth-gpu.html',
              description: 'Demonstrates use of a depth API in immersive-ar session. ' +
                           'The data will be uploaded to the GPU & accessed from a shader to visualize the depth map.' },
            { title: 'AR Depth Sensing - CPU access', category: 'AR',
              path: 'phone-ar-depth.html',
              description: 'Demonstrates use of a depth API in immersive-ar session. ' +
                           'The data will be accessed on the CPU.' },
          ];

          let mainElement = document.getElementById("main");

          // Append an element for every item in the pages list.
          for (var i = 0; i < pages.length; ++i) {
            var page = pages[i];

            let article = document.createElement('article');

            let title = document.createElement('h3');
            title.setAttribute('data-index', i + 1);

            let titleLink = document.createElement('a');
            titleLink.href = page.path;
            titleLink.innerHTML = page.title;
            title.appendChild(titleLink);
            article.appendChild(title);

            let category = document.createElement('h4');
            category.innerHTML = page.category;
            article.appendChild(category);

            let description = document.createElement('p');
            description.innerHTML = page.description;
            article.appendChild(description);

            let links = document.createElement('div');
            links.classList.add('links');

            let liveLink = document.createElement('a');
            liveLink.href = page.path;
            liveLink.innerHTML = 'Open';
            links.appendChild(liveLink);

            let polyfillLink = document.createElement('a');
            polyfillLink.href = page.path + '?allowPolyfill=1';
            polyfillLink.innerHTML = 'Open with Polyfill';
            links.appendChild(polyfillLink);

            if (page.variants) {
              for (let i = 0; i < page.variants.length; ++i) {
                let variant = page.variants[i];
                let link = document.createElement('a');
                link.href = page.path + variant.query;
                link.innerHTML = variant.name;
                links.appendChild(link);
              }
            }

            let sourceLink = document.createElement('a');
            sourceLink.href = 'https://cs.chromium.org/chromium/src/third_party/webxr_test_pages/webxr-samples/proposals/' + page.path;
            sourceLink.innerHTML = 'Source';
            links.appendChild(sourceLink);

            article.appendChild(links);

            mainElement.appendChild(article);
          }
        </script>
      </main>

      <br/>

      <h3><a class='github-link' href='https://github.com/immersive-web/webxr-samples'>View source on GitHub</a></h3>

      <footer class='footer'>
      </footer>
    </div>
  </body>
</html>
